﻿using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Reflection.Metadata.Ecma335;
using CommunityToolkit.Mvvm.ComponentModel;

namespace WindowsStyle;

public partial class MainViewModel:ObservableObject
{

    #region Listbox多选操作的两种方式
    [ObservableProperty]
    ObservableCollection<Person> _people = new()
    {
        new Person(){Age = 13,Name = "张三"},
        new Person(){Age = 14,Name = "李四"},
        new Person(){Age = 15,Name = "王五"},
        new Person(){Age = 16,Name = "赵六"},
    };

    [ObservableProperty] ObservableCollection<Person> _behaviorPeopleCollection = new();


    [ObservableProperty]
    ObservableCollection<Person> _selectedPeoples = new();





    #endregion


    public MainViewModel()
    {
        
    }

}

public class Person
{
    public string Name { get; set; }
    public int Age { get; set; }
}